package cn.secondquestion;

public class Circle extends Graph{
    final static double Pi=3.14;
    private int r;

    public Circle(int i){

    }

    public Circle(int h, int l, int r) {
        super(h, l);
        this.r = r;
    }



    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }

    public void area(){
        double s= Math.pow(r,2)*Pi;
        System.out.println("圆的面积为："+s);
    }
    public void perimeter(){
        double l=2*r*Pi;
        System.out.println("圆的周长为："+l);
    }

}
